Incorporate a timeout so as not to block boot (Mitigates #737613).
This code was taken from the upstream initscript and adapted, so it is
pretty well tested.
(cherry picked from commit
57e0a490c53a029d0921edde9e1acdc158ac2164)
Conflicts:
debian/changelog
debian/xen-utils-common.xen.init
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Start a qemu process in dom0 to service the toolstacks loopback disk
attaches. (Closes: #770456)
* Remove correct pidfile when stopping xenconsoled.
+ * Check that xenstored has actually started before talking to it.
+ Incorporate a timeout so as not to block boot (Mitigates #737613)
[ Lubomir Host ]
* Fix xen-init-name to not fail looking for a nonexistent 'config'
start-stop-daemon --start --quiet --pidfile "$XENSTORED_PIDFILE" --exec "$XENSTORED" -- \
$XENSTORED_ARGS --pid-file="$XENSTORED_PIDFILE" \
|| return 2
+
+ # Wait for xenstored to actually come up, timing out after 30 seconds
+ local time=0
+ local timeout=30
+ while [ $time -lt $timeout ] && ! `/usr/sbin/xenstore-read -s / >/dev/null 2>&1` ; do
+ time=$(( $time+1 ))
+ sleep 1
+ done
+
+ # Exit if we timed out
+ if ! [ $time -lt $timeout ] ; then
+ return 2
+ fi
}
init_dom0()